<template>
<div style="padding-top: 40px;">
    <blur :height='130' :blur-amount='40' :url="url">
      <p class="center"><img :src="url"></p>
    </blur>
    <group>
      <cell title="个人资料" is-link :link="{path:'/myinfo'}"></cell>
      <cell title="修改密码" is-link :link="{path:'/updatepwd'}"></cell>
      <cell title="问题反馈" is-link :link="{path:'/question'}"></cell>
      <!-- <cell title="我的排课" is-link :link="{path:'/teacherAppointment'}"></cell>
      <cell title="我的预约" is-link :link="{path:'/studentAppointment'}"></cell> -->
    </group>
    <br>
    <box  gap="15px 15px">
     <x-button type="warn" @click.native="logout">退出</x-button>
    </box>
</div>    
</template>
<script>
 import bottomnav from '../../components/bottomnav'
 import topbutton from '../../components/topbutton'
 import { Group, Cell, XButton, Box, Blur } from 'vux'

export default {
   data () {
     return {
       url: ''
     }
   },
   created () {
     this.$http.get('/api/ac/user/selfInfo').then((res) => {
       this.url = '/api/' + res.data.content.image
     })
   },
   methods: {
     logout () {
       this.$http.post('/api/ac/user/logout').then((res) => {
         if (res.data.code === 0) {
           this.$router.push('/login')
         } else {
           alert('发生错误，请重试')
         }
       })
     }
   },
   components: {
     bottomnav,
     topbutton,
     Cell,
     Group,
     XButton,
     Box,
     Blur
   }
}
</script>
<style scoped>
.center {
  text-align: center;
  padding-top: 20px;
  color: #fff;
  font-size: 18px;
}
.center img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 1px solid #ececec;
}
</style>
